<template>
  <nav class="navbar">
    <div class="nav-container">
      <a href="#" class="nav-item active">首页</a>
      <a href="#" class="nav-item">志愿服务</a>
      <a href="#" class="nav-item">技能培训</a>
      <a href="#" class="nav-item">交流活动&赛事发布</a>
      <a href="#" class="nav-item">福利兑换</a>
      <a href="#" class="nav-item">经费申报</a>
    </div>
  </nav>
</template>
<style>
body,
html {
  margin: 0;
  padding: 0;
}

.navbar {
  background-color: rgba(0, 0, 0, 0.127);
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

.nav-container {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 1px 20px;
}

.nav-item {
  position: relative;
  flex-grow: 1;
  text-align: center;
  padding: 14px 16px;
  text-decoration: none;
  color: white;
  cursor: pointer;
  overflow: hidden;
}

.nav-item:hover {
  background-color: rgba(13, 12, 12, 0.849);
}

.nav-item:hover::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 16.6667%;
  height: 100%;
  background-color: rgba(13, 12, 12, 0.327);
  transition: width 0.3s ease;
}

.active {
  background-color: rgba(13, 12, 12, 0.327);
}

.nav-item:hover a {
  color: black;
}

a {
  color: inherit;
  text-decoration: none;
}
</style>
<script>
export default {
  name: 'NavBar'
  // other options...
}
</script>
